package com.igeek.Client;

import com.igeek.service.AccountService;
import com.igeek.service.impl.AccountServiceImpl;

/**
 * 客户层
 *      两个账户之间的转账过程，保持事务的一致性
 */
public class ClientDemo {

    public static void main(String[] args) {
        AccountService accountService = new AccountServiceImpl();

        //开始转账
        try {
            boolean isTrue = accountService.transfer("1","2",1000);

            if(isTrue){
                System.out.println("转账成功");
            }else{
                System.out.println("转账失败");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
